<?php
class FormField
{
	private $s_fieldId;
	private $s_fieldValue;
	private $s_fieldType;
	private $s_fieldLabel;
	private $s_fieldName;
	public $arr_errorMessages;
	
	public function getFieldId()
	{
		return $this->s_fieldId;
	}
	
	public function getFieldName()
	{
		/*
		if($this->getFieldType() == 'checkbox' || $this->getFieldType() == 'radio'){
			return $this->s_fieldName.'[]';
		}else{
			return $this->s_fieldName;
		}
		*/
		return $this->s_fieldName;
		
	}
	
	public function getErrorMessage()
	{
		if(is_array($this->arr_errorMessages)){
			//output the first value only
			$s_errorMessage = reset($this->arr_errorMessages);
		}else{
			$s_errorMessage = '';
		}
		return $s_errorMessage;
	}
	
	public function getFieldValue()
	{
		return $this->s_fieldValue;
	}
	
	public function getFieldType()
	{
		return $this->s_fieldType;
	}
	
	public function getFieldLabel()
	{
		return $this->s_fieldLabel;
	}
	
	public function setFieldId($s_fieldId)
	{
		$this->s_fieldId = $s_fieldId;	
	}
	
	public function setFieldName($s_fieldName)
	{
		$this->s_fieldName = $s_fieldName;
	}
	
	public function setErrorMessage($arr_errorMessage)
	{
		$this->arr_errorMessages[] = $arr_errorMessage;
	}
	
	public function setFieldValue($s_fieldValue)
	{
		$this->s_fieldValue = $s_fieldValue;
	}
	
	public function setFieldType($s_fieldType)
	{
		$this->s_fieldType = $s_fieldType;
	}
	
	public function setFieldLabel($s_fieldLabel)
	{
		$this->s_fieldLabel = $s_fieldLabel;
	}
}